#!/usr/bin/env ruby

$:.unshift File.expand_path("../lib/", __FILE__)
require 'thunder'
require 'thunder/options/trollop'

class Bar
  include Thunder

  desc "doit", "do something with the Bar class"
  option :verb, type: Boolean, desc: "verbosity"
  def doit(options={})
    p options
  end
end

class Foo
  include Thunder

  #options_processor TrollopAdapter

  desc "noargs", ""
  def noargs
  end

  desc "bar A", "desc"
  def bar(a)
    p a
  end

  desc "baz [options]"
  option :flag, type: Boolean, short: "g", desc: "run with a flag"
  option :some, type: String, desc: "something", default: "some default value"
  def baz(options = {})
    p options
  end

  desc "splat", ""
  def splat(a, b, *args)
  end

  desc "defs", ""
  def defs(a = 1, b = 2, c = 3)
  end

  desc "block", ""
  def block(a, &block)
  end

  desc "complex", ""
  def complex(a, b = 2, *args, &block)
  end

  desc "quux COMMAND...", "send COMMAND to Bar"
  subcommand "quux", ::Bar.new

end


Foo.new.start
